#!/usr/bin/env node

const lib = require("aimon-test-lib");
const argv = require("process").argv;
const command = argv[2];
const options = argv.slice(3);
if (options.length > 1) {
  let [option, pararms] = options;
  option = option.replace("--", "");
  if (command) {
    if (lib[command]) {
      lib[command](option, pararms);
    } else {
      console.log("命令无效");
    }
  } else {
    console.log("请输入命令");
  }
}

if (command.startsWith("--") || command.startsWith("-")) {
  const globalOption = command.replace(/--|-/g, "");
  if (globalOption === "version") {
    console.log("v1.0.0");
  }
}
